/**
 * Copyright (c) 2016-2019 九点科技 All rights reserved.
 *
 * http://www.9dyun.cn
 *
 * 版权所有，侵权必究！
 */
package com.dian.modules.sale.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.baomidou.mybatisplus.annotation.TableField;
import com.dian.common.validator.group.AddGroup;
import com.dian.common.validator.group.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.dian.common.entity.BaseEntity;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
/**
 * 预订单
 *
 * @author xiaolai
 * @email xiaolai@9dyun.cn
 * @date 2019-06-10 23:04:30
 */
@Data
@TableName("sale_prob_head")
@ExcelTarget("probHeadEntity")
public class ProbHeadEntity extends BaseEntity {
	private static final long serialVersionUID = 1L;

    /**
	 * 预订单编码
	 */
    @Excel(name = "预订单编码", height = 20, width = 20, orderNum ="0")
    @NotBlank(message="预订单编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="预订单编码长度不能超过20个字符")
    private String probNo;


    /**
	 * 订单日期;format:yyyy-mm-dd
	 */
    @Excel(name = "订单日期", exportFormat = "yyyy-MM-dd", orderNum = "1")
    @JsonFormat( pattern="yyyy-MM-dd")
    @NotNull(message="订单日期不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Date probDate;

    /**
     * 订单月份;format:yyyy-mm-dd
     */
    @NotBlank(message="订单月份不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private String probMonth;


    /**
	 * 门店id;来源于base_store.id
	 */
    @NotNull(message="门店id不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long storeId;



    /**
	 * 门店名称;来源于base_store.customer_name
	 */
    @Excel(name = "门店名称", width = 30,  orderNum = "2")
    @NotBlank(message="门店名称不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=60,  groups ={AddGroup.class, UpdateGroup.class}, message="门店名称长度不能超过60个字符")
    private String storeName;



    /**
	 * 客户ID;来源于base_customer.id
	 */
    @NotNull(message="客户ID不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long customerId;


    /**
	 * 客户编码;来源于base_customer.customer_code
	 */
    @Excel(name = "客户编码",  orderNum = "3")
    @NotBlank(message="客户编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="客户编码长度不能超过20个字符")
    private String customerCode;


    /**
	 * 客户名称;来源于base_customer.customer_name
	 */
    @Excel(name = "客户名称",  orderNum = "4")
    @NotBlank(message="客户名称不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="客户名称长度不能超过40个字符")
    private String customerName;


    /**
	 * 客户联系人;来源于base_customer.customer_contact_name
	 */
    @Excel(name = "客户联系人",  orderNum = "5")
    @NotBlank(message="客户联系人不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="客户联系人长度不能超过40个字符")
    private String customerContactName;


    /**
	 * 客户电话;来源于base_customer.customer_tel
	 */
    @Excel(name = "客户电话",width = 30,   orderNum = "6")
    @NotBlank(message="客户电话不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="客户电话长度不能超过40个字符")
    private String customerContactTel;


    /**
	 * 送货地址;来源于base_customer.customer_add
	 */
    @Excel(name = "送货地址", width = 60, orderNum = "7")
    @NotBlank(message="送货地址不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="送货地址长度不能超过40个字符")
    private String customerContactAdd;



    /**
	 * 导购员Id;来源于sys_user.id
	 */
    @NotNull(message="导购员Id不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long guideId;


    /**
	 * 导购员名称;来源于sys_user.user_name
	 */
    @Excel(name = "导购员名称", width = 30, orderNum = "8")
    @NotBlank(message="导购员名称不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="导购员名称长度不能超过40个字符")
    private String guideName;


    /**
	 * 订单状态:1-未审核-WAITCHECK;2-已审核-AUDITED-;99-已作废-INVALID
	 */
    @Excel(name = "订单状态", replace = {"未审核_1", "已审核_2","已作废_99"}, orderNum = "9")
    @NotNull(message="订单状态不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Integer orderState;


    /**
	 * 审核人ID
	 */
    private Long checkUserId;


    /**
	 * 审核人
	 */
    @Excel(name = "审核人",  orderNum = "10")
    private String checkUserName;


    /**
	 * 审核时间;format:yyyy-MM-dd HH:mm:ss
	 */
    @JsonFormat( pattern="yyyy-MM-dd HH:mm:ss")
    @Excel(name = "审核时间",width = 30,  exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "11")
    private Date checkDate;



    /**
	 * 订单类型:1-产品-PRODUCT;2-辅料-ACCES
	 */
    @Excel(name = "订单状态", replace = {"产品_1", "辅料_2"}, orderNum = "12")
    @NotNull(message="订单类型不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Integer orderType;



    /**
	 * 安装日期;format:yyyy-MM-dd HH:mm:ss
	 */
    @JsonFormat( pattern="yyyy-MM-dd")
    @Excel(name = "安装日期",width = 30,  exportFormat = "yyyy-MM-dd", orderNum = "13")
    private Date installDate;


    /**
	 * 安装标记:1-未安装-NO;2-已安装-YES
	 */
    @Excel(name = "安装标记", replace = {"未安装_1", "已安装_2"}, orderNum = "14")
    private Integer installFlag;



    /**
	 * 量尺标记:1-未量尺-NO;2-已量尺-YES
	 */
    @Excel(name = "量尺标记", replace = {"未量尺_1", "已量尺_2"}, orderNum = "15")
    private Integer rulerFlag;


    /**
     * 是否已转销售订单:0-否-NO;1-是-YES
     */
    @Excel(name = "已转销售订单", replace = {"否_0", "是_1"}, orderNum = "16")
    private Integer isSale;



    /**
     * 预订单明细
     */
    @TableField(exist = false)
    @ExcelCollection(name = "预订单明细", orderNum = "17")
    private List<ProbLineEntity> probLineEntityList;
}
